package vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.part;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.eclipse.gef.Tool;
import org.eclipse.gef.palette.PaletteContainer;
import org.eclipse.gef.palette.PaletteDrawer;
import org.eclipse.gef.palette.PaletteRoot;
import org.eclipse.gef.palette.PaletteSeparator;
import org.eclipse.gef.palette.ToolEntry;
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeConnectionTool;
import org.eclipse.gmf.runtime.diagram.ui.tools.UnspecifiedTypeCreationTool;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;

import vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.diagram.providers.AdaptedauiElementTypes;

/**
 * @generated
 */
public class AdaptedauiPaletteFactory {

	/**
	 * @generated
	 */
	public void fillPalette(PaletteRoot paletteRoot) {
		paletteRoot.add(createEntity1Group());
		paletteRoot.add(createLink2Group());
	}

	/**
	 * Creates "Entity" palette tool group
	 * @generated
	 */
	private PaletteContainer createEntity1Group() {
		PaletteDrawer paletteContainer = new PaletteDrawer(
				Messages.Entity1Group_title);
		paletteContainer.setId("createEntity1Group"); //$NON-NLS-1$
		paletteContainer.add(createPresentationUnit1CreationTool());
		paletteContainer.add(createAbstractPresentation2CreationTool());
		paletteContainer.add(createAbstractUIComponent3CreationTool());
		paletteContainer.add(createInputField4CreationTool());
		paletteContainer.add(createOutputField5CreationTool());
		paletteContainer.add(createMultipleChoice6CreationTool());
		paletteContainer.add(createSingleChoice7CreationTool());
		paletteContainer.add(createNavigator8CreationTool());
		paletteContainer.add(createActivator9CreationTool());
		return paletteContainer;
	}

	/**
	 * Creates "Link" palette tool group
	 * @generated
	 */
	private PaletteContainer createLink2Group() {
		PaletteDrawer paletteContainer = new PaletteDrawer(
				Messages.Link2Group_title);
		paletteContainer.setId("createLink2Group"); //$NON-NLS-1$
		paletteContainer.add(createContainerRelationship1CreationTool());
		paletteContainer
				.add(createCommandDestinationsRelationship2CreationTool());
		paletteContainer.add(new PaletteSeparator());
		paletteContainer.add(createChoice4CreationTool());
		paletteContainer.add(createOrderIndependency5CreationTool());
		paletteContainer.add(createConcurrent6CreationTool());
		paletteContainer.add(createConcurrentWithInfoExchange7CreationTool());
		paletteContainer.add(createDisabling8CreationTool());
		paletteContainer.add(createSuspendResume9CreationTool());
		paletteContainer.add(createEnabling10CreationTool());
		paletteContainer.add(createEnablingWithInfoExchange11CreationTool());
		paletteContainer.add(createTIteration12CreationTool());
		paletteContainer.add(createTOption13CreationTool());
		paletteContainer.add(createUndefined14CreationTool());
		return paletteContainer;
	}

	/**
	 * @generated
	 */
	private ToolEntry createPresentationUnit1CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.PresentationUnit1CreationTool_title,
				Messages.PresentationUnit1CreationTool_desc,
				Collections
						.singletonList(AdaptedauiElementTypes.PresentationUnit_2001));
		entry.setId("createPresentationUnit1CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/PresentationUnit.gif")); //$NON-NLS-1$
		entry.setLargeIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/PresentationUnit.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createAbstractPresentation2CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.AbstractPresentation2CreationTool_title,
				Messages.AbstractPresentation2CreationTool_desc,
				Collections
						.singletonList(AdaptedauiElementTypes.AbstractPresentation_2002));
		entry.setId("createAbstractPresentation2CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/AbstractPresentation.gif")); //$NON-NLS-1$
		entry.setLargeIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/AbstractPresentation.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createAbstractUIComponent3CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.AbstractUIComponent_3001);
		types.add(AdaptedauiElementTypes.AbstractUIComponent_3009);
		NodeToolEntry entry = new NodeToolEntry(
				Messages.AbstractUIComponent3CreationTool_title,
				Messages.AbstractUIComponent3CreationTool_desc, types);
		entry.setId("createAbstractUIComponent3CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/AbstractUIComponent.gif")); //$NON-NLS-1$
		entry.setLargeIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/AbstractUIComponent.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createInputField4CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.InputField4CreationTool_title,
				Messages.InputField4CreationTool_desc,
				Collections
						.singletonList(AdaptedauiElementTypes.InputField_3003));
		entry.setId("createInputField4CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/InputField.gif")); //$NON-NLS-1$
		entry.setLargeIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/InputField.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createOutputField5CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.OutputField5CreationTool_title,
				Messages.OutputField5CreationTool_desc,
				Collections
						.singletonList(AdaptedauiElementTypes.OutputField_3004));
		entry.setId("createOutputField5CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/OutputField.gif")); //$NON-NLS-1$
		entry.setLargeIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/OutputField.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createMultipleChoice6CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.MultipleChoice6CreationTool_title,
				Messages.MultipleChoice6CreationTool_desc,
				Collections
						.singletonList(AdaptedauiElementTypes.MultipleChoice_3002));
		entry.setId("createMultipleChoice6CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/MultipleChoice.gif")); //$NON-NLS-1$
		entry.setLargeIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/MultipleChoice.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createSingleChoice7CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.SingleChoice7CreationTool_title,
				Messages.SingleChoice7CreationTool_desc,
				Collections
						.singletonList(AdaptedauiElementTypes.SingleChoice_3006));
		entry.setId("createSingleChoice7CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/SingleChoice.gif")); //$NON-NLS-1$
		entry.setLargeIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/SingleChoice.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createNavigator8CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.Navigator8CreationTool_title,
				Messages.Navigator8CreationTool_desc,
				Collections
						.singletonList(AdaptedauiElementTypes.Navigator_3005));
		entry.setId("createNavigator8CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/Navigator.gif")); //$NON-NLS-1$
		entry.setLargeIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/Navigator.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createActivator9CreationTool() {
		NodeToolEntry entry = new NodeToolEntry(
				Messages.Activator9CreationTool_title,
				Messages.Activator9CreationTool_desc,
				Collections
						.singletonList(AdaptedauiElementTypes.Activator_3007));
		entry.setId("createActivator9CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/Activator.gif")); //$NON-NLS-1$
		entry.setLargeIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/Activator.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createContainerRelationship1CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UIContainerRelationship_4012);
		types.add(AdaptedauiElementTypes.PresentationContainerRelationship_4013);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ContainerRelationship1CreationTool_title,
				Messages.ContainerRelationship1CreationTool_desc, types);
		entry.setId("createContainerRelationship1CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/ContainerRelationship.gif")); //$NON-NLS-1$
		entry.setLargeIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/ContainerRelationship.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createCommandDestinationsRelationship2CreationTool() {
		LinkToolEntry entry = new LinkToolEntry(
				Messages.CommandDestinationsRelationship2CreationTool_title,
				Messages.CommandDestinationsRelationship2CreationTool_desc,
				Collections
						.singletonList(AdaptedauiElementTypes.CommandDestinations_4014));
		entry.setId("createCommandDestinationsRelationship2CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/CommandDestinations.gif")); //$NON-NLS-1$
		entry.setLargeIcon(AdaptedauiDiagramEditorPlugin
				.findImageDescriptor("/vn.edu.hcmus.fit.se.mdd.mbuid.adaptedaui.edit/icons/full/obj16/CommandDestinations.gif")); //$NON-NLS-1$
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createChoice4CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UITemporalRelationship_4001);
		types.add(AdaptedauiElementTypes.PresentationTemporalRelationship_4015);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.Choice4CreationTool_title,
				Messages.Choice4CreationTool_desc, types);
		entry.setId("createChoice4CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiElementTypes
				.getImageDescriptor(AdaptedauiElementTypes.UITemporalRelationship_4001));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createOrderIndependency5CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UITemporalRelationship_4002);
		types.add(AdaptedauiElementTypes.PresentationTemporalRelationship_4016);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.OrderIndependency5CreationTool_title,
				Messages.OrderIndependency5CreationTool_desc, types);
		entry.setId("createOrderIndependency5CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiElementTypes
				.getImageDescriptor(AdaptedauiElementTypes.UITemporalRelationship_4002));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createConcurrent6CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UITemporalRelationship_4003);
		types.add(AdaptedauiElementTypes.PresentationTemporalRelationship_4017);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.Concurrent6CreationTool_title,
				Messages.Concurrent6CreationTool_desc, types);
		entry.setId("createConcurrent6CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiElementTypes
				.getImageDescriptor(AdaptedauiElementTypes.UITemporalRelationship_4003));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createConcurrentWithInfoExchange7CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UITemporalRelationship_4004);
		types.add(AdaptedauiElementTypes.PresentationTemporalRelationship_4018);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.ConcurrentWithInfoExchange7CreationTool_title,
				Messages.ConcurrentWithInfoExchange7CreationTool_desc, types);
		entry.setId("createConcurrentWithInfoExchange7CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiElementTypes
				.getImageDescriptor(AdaptedauiElementTypes.UITemporalRelationship_4004));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createDisabling8CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UITemporalRelationship_4005);
		types.add(AdaptedauiElementTypes.PresentationTemporalRelationship_4019);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.Disabling8CreationTool_title,
				Messages.Disabling8CreationTool_desc, types);
		entry.setId("createDisabling8CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiElementTypes
				.getImageDescriptor(AdaptedauiElementTypes.UITemporalRelationship_4005));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createSuspendResume9CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UITemporalRelationship_4006);
		types.add(AdaptedauiElementTypes.PresentationTemporalRelationship_4020);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.SuspendResume9CreationTool_title,
				Messages.SuspendResume9CreationTool_desc, types);
		entry.setId("createSuspendResume9CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiElementTypes
				.getImageDescriptor(AdaptedauiElementTypes.UITemporalRelationship_4006));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createEnabling10CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UITemporalRelationship_4007);
		types.add(AdaptedauiElementTypes.PresentationTemporalRelationship_4021);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.Enabling10CreationTool_title,
				Messages.Enabling10CreationTool_desc, types);
		entry.setId("createEnabling10CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiElementTypes
				.getImageDescriptor(AdaptedauiElementTypes.UITemporalRelationship_4007));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createEnablingWithInfoExchange11CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UITemporalRelationship_4008);
		types.add(AdaptedauiElementTypes.PresentationTemporalRelationship_4022);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.EnablingWithInfoExchange11CreationTool_title,
				Messages.EnablingWithInfoExchange11CreationTool_desc, types);
		entry.setId("createEnablingWithInfoExchange11CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiElementTypes
				.getImageDescriptor(AdaptedauiElementTypes.UITemporalRelationship_4008));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createTIteration12CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UITemporalRelationship_4009);
		types.add(AdaptedauiElementTypes.PresentationTemporalRelationship_4023);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.TIteration12CreationTool_title,
				Messages.TIteration12CreationTool_desc, types);
		entry.setId("createTIteration12CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiElementTypes
				.getImageDescriptor(AdaptedauiElementTypes.UITemporalRelationship_4009));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createTOption13CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UITemporalRelationship_4010);
		types.add(AdaptedauiElementTypes.PresentationTemporalRelationship_4024);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.TOption13CreationTool_title,
				Messages.TOption13CreationTool_desc, types);
		entry.setId("createTOption13CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiElementTypes
				.getImageDescriptor(AdaptedauiElementTypes.UITemporalRelationship_4010));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private ToolEntry createUndefined14CreationTool() {
		ArrayList<IElementType> types = new ArrayList<IElementType>(2);
		types.add(AdaptedauiElementTypes.UITemporalRelationship_4011);
		types.add(AdaptedauiElementTypes.PresentationTemporalRelationship_4025);
		LinkToolEntry entry = new LinkToolEntry(
				Messages.Undefined14CreationTool_title,
				Messages.Undefined14CreationTool_desc, types);
		entry.setId("createUndefined14CreationTool"); //$NON-NLS-1$
		entry.setSmallIcon(AdaptedauiElementTypes
				.getImageDescriptor(AdaptedauiElementTypes.UITemporalRelationship_4011));
		entry.setLargeIcon(entry.getSmallIcon());
		return entry;
	}

	/**
	 * @generated
	 */
	private static class NodeToolEntry extends ToolEntry {

		/**
		 * @generated
		 */
		private final List<IElementType> elementTypes;

		/**
		 * @generated
		 */
		private NodeToolEntry(String title, String description,
				List<IElementType> elementTypes) {
			super(title, description, null, null);
			this.elementTypes = elementTypes;
		}

		/**
		 * @generated
		 */
		public Tool createTool() {
			Tool tool = new UnspecifiedTypeCreationTool(elementTypes);
			tool.setProperties(getToolProperties());
			return tool;
		}
	}

	/**
	 * @generated
	 */
	private static class LinkToolEntry extends ToolEntry {

		/**
		 * @generated
		 */
		private final List<IElementType> relationshipTypes;

		/**
		 * @generated
		 */
		private LinkToolEntry(String title, String description,
				List<IElementType> relationshipTypes) {
			super(title, description, null, null);
			this.relationshipTypes = relationshipTypes;
		}

		/**
		 * @generated
		 */
		public Tool createTool() {
			Tool tool = new UnspecifiedTypeConnectionTool(relationshipTypes);
			tool.setProperties(getToolProperties());
			return tool;
		}
	}
}
